from chapter5.regular_test.re_test_patterns import test_patterns

if __name__ == '__main__':
    text = 'This is some text -- with punctuation.'

    patterns = [
        (r"^\w+", "字符串开始的词"),
        (r"\A\w+", "字符串开始的词"),
        (r"\w+\S*$", "字符串结束的词"),
        (r"\w+\S*\Z", "字符串结束的词"),
        (r"\w*t\w*","带有字符 t 的词"),
        (r"\bt\w+","以 t 字符开头的词"),
        (r"\w+t\b","以 t 字符结尾的词"),
        (r"\w+t\w+", "字符 t 在词中间的词"),
        (r"\w*\Bt\B\w*", "字符 t 在词中间的词"),
        (r"\w+\Bt\B\w+", "字符 t 在词中间的词"),

    ]

    test_patterns(text=text, patterns=patterns)
